#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    int n = 0, m = 0, number = 0, sum = 0;
    scanf("%d %d", &m, &n);
    int i = 0;
    for (i = 0; i < n; i++)
    {
        int j = 0;
        for (j = 0; j < m; j++)
        {
            scanf("%d", &number);
            if (number > 0)
            {
                sum += number;
            }
        }
    }
    printf("%d", sum);
    return 0;
}
